﻿@model WI.CandidateManager.Common.Data.Entities.Test

@{
    ViewBag.Title = "Assign Test to Candidates";
}

<h2>Assign Test to Candidates</h2>

<table class="bordered">
    <tr>
        <td class="vertical-header">@Html.DisplayNameFor(model => model.Name)</td>
        <td>@Html.DisplayFor(model => model.Name, new { @class = "" })</td>
    </tr>
    <tr>
        <td class="vertical-header">@Html.DisplayNameFor(model => model.Description)</td>
        <td>
            <pre>@Html.DisplayFor(model => model.Description, new { @class = "" })</pre>
        </td>
    </tr>
    <tr>
        <td class="vertical-header">@Html.DisplayNameFor(model => model.State)</td>
        <td>@Html.DisplayFor(model => model.State, new { @class = "" })</td>
    </tr>
    <tr>
        <td class="vertical-header">@Html.DisplayNameFor(model => model.Owner.ShortName)</td>
        <td>@Html.DisplayFor(model => model.Owner.ShortName, new { @class = "" })</td>
    </tr>
</table>

<h3>Assigned Candidates</h3>

<p>@Html.ActionLink("+ Assign Groups", "AssignToGroups", new { @TestId = Model.Id }, new { @class = "common-btn BlueColor" }) @Html.ActionLink("+ Assign Candidates", "AssignToCandidates", new { @TestId = Model.Id }, new { @class = "common-btn BlueColor" })</p>

<table class="bordered">
    <thead>
        <tr>
            <th>@Resources.Common.CommonButtonDetails</th>
            <th>Fullname</th>
            <th>Group</th>
            <th>Remove</th>
        </tr>
    </thead>
    @foreach (var candidate in Model.Candidate)
    {
        <tr>
            <td class="Center column-detail">@Html.ActionLink(@Resources.Common.CommonButtonDetails, "Detail", "Candidates", new { @CandidateId = candidate.Id }, new { @class = "common-btn BlueColor" })</td>
            <td>@candidate.FullName</td>
            <td>@candidate.StudyGroup.First(g => g.Couch.Any(c => c.Id == Model.Owner.Id)).GroupName</td>
            <td class="Center column-detail">@Html.ActionLink("Remove", "RemoveCandidate", new { @CandidateId = candidate.Id, @TestId = Model.Id }, new { @class = "common-btn BlueColor" })</td>
        </tr>
    }
</table>

<p>
    @Html.ActionLink(@Resources.Common.CommonButtonBack, "List", "Tests", new { @class = "common-btn-large BlueColor" })
</p>
